function leftTrim(sIn){
	var sOut = sIn;
	var regExp = new RegExp("^ ");
	while(regExp.test(sOut))
		sOut = sOut.replace(regExp, "");
	return sOut
}

function rightTrim(sIn){
	var sOut = sIn;
	var regExp = new RegExp(" $");
	while(regExp.test(sOut))
		sOut = sOut.replace(regExp, "");
	return sOut
}

function trim(sIn){
	return leftTrim(rightTrim(sIn));
}

function isContained(sComparand,sList,sDivision){
	if(sComparand==null||sComparand==""||sList==null||sList==""||sDivision==null||sDivision=="")
		return false;
  var sCorrectorList = sList;
	var nLength = sList.length;
  if(sCorrectorList.substr(nLength-1)!=sDivision)
		sCorrectorList = sList + sDivision;
 	while(sCorrectorList.length!=0){
    var index = sCorrectorList.indexOf(sDivision);
    var sMenber = sCorrectorList.substring(0,index);
    if(sMenber==sComparand) return true;
    sCorrectorList = sCorrectorList.substr(index+1);
  }
	return false;
}
